import QtQuick 1.0
import com.nokia.symbian 1.0
import "../js/Storage.js" as Storage
import "../delegate"

PurePage {
    id: sessionOpenDetailPage

    anchors { fill: parent; topMargin: statusBar.height; bottomMargin: toolBar.height }
    signal sessionDetail(int id)

    ListModel {
        id: sessionDetailModel
    }

    LodingIndicator {
        id: lodingSessionOpenDetailPage
    }

    ListView {
        id: sessionDetailListView

        anchors { fill: parent}
        cacheBuffer: 2 * height
        delegate: SessionOpenDetailDelegate {}
        model: sessionDetailModel
    }

    ScrollBar {
        flickableItem: sessionDetailListView
        anchors { right: sessionDetailListView.right; top: sessionDetailListView.top }
    }

    onSessionDetail: {
        sessionDetailModel.clear();
        Storage.getSessionDetailCache(id, sessionDetailModel);
    }

}
